Misc cleanups around Netty4HttpPipeliningHandler#104642
Merged
DaveCTurner merged 3 commits intoelastic:mainfrom Jan 24, 2024
Merged
Misc cleanups around Netty4HttpPipeliningHandler#104642DaveCTurner merged 3 commits intoelastic:mainfrom
Netty4HttpPipeliningHandler#104642DaveCTurner merged 3 commits intoelastic:mainfrom
Conversation
- Make `Netty4HttpResponse` sealed, we need to know all its impls - Rename `Netty4FullHttpResponse` to contrast with chunked response - Rename `doWrite` overloads - Reorder `finishChunkedWrite()`, we're ready to handle the next response before completing the promise - Add missing test for splitting large responses - Add a few extra assertions - Clean up IDE warnings
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
pxsalehi
approved these changes
Jan 23, 2024
Member
pxsalehi
left a comment
There was a problem hiding this comment.
LGTM (although I am still getting to learn this area, so it might worth waiting for a second one).
| embeddedChannel.writeAndFlush(response, promise); | ||
| assertTrue(promise.isDone()); | ||
| assertThat(messagesSeen, hasSize(1)); | ||
| assertSame(response, messagesSeen.get(0)); |
Member
There was a problem hiding this comment.
should we also assert that the seen message is an instance of full HTTP response?
ywangd
approved these changes
Jan 24, 2024
| import org.elasticsearch.http.HttpResponse; | ||
|
|
||
| public interface Netty4RestResponse extends HttpResponse, HttpMessage { | ||
| public sealed interface Netty4RestResponse extends HttpResponse, HttpMessage permits Netty4FullHttpResponse, Netty4ChunkedHttpResponse { |
Member
There was a problem hiding this comment.
Should we rename this interface to Nett4HttpResponse since the other class is now called Netty4FullHttpResponse? The usage of Rest is inconsistent with other classes.
Member
Author
There was a problem hiding this comment.
Yeah it was a little noisy to do that in this same PR, I opened #104675.
Member
Author
|
FWIW this was opened to prepare things for #104851. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Netty4HttpResponsesealed, we need to know all its implsNetty4FullHttpResponseto contrast with chunked responsedoWriteoverloadsfinishChunkedWrite(), we're ready to handle the nextresponse before completing the promise